package com.example.networktest.Util;

import com.example.networktest.Service.NewsApiService;

import retrofit2.Retrofit;


public class ApiClient {
  private static final String BASE_URL = "http://v.juhe.cn/toutiao/";
  private static Retrofit retrofit;

  public static Retrofit getRetrofitInstance() {
    if (retrofit == null) {
      retrofit = new Retrofit.Builder()
          .baseUrl(BASE_URL)

          .build();
    }
    return retrofit;
  }

  public static NewsApiService getNewsApiService() {
    return getRetrofitInstance().create(NewsApiService.class);
  }
}
